import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class ErrTyp {
	public static final int MODE = 1;
	public static final int UNIT = 2;
	public static final int DATA = 3;
	public List<Integer> ErrTyps; 
	public Iterator<Integer> curr_err;
	int curr;
	
	ErrTyp() {
		ErrTyps = Arrays.asList(MODE, UNIT, DATA);
		curr_err = ErrTyps.iterator();
		curr = -1;
	}
	
	public int next_err() {
		if(curr_err.hasNext()) {
			curr = curr_err.next();
			return curr;
		}
		else {
			return -1;
		}
	}
	
	public String toString() {
		switch(curr) {
		case MODE:
			return "MODE ERR";
		case UNIT:
			return "UNIT ERR";
		case DATA:
			return "DATA ERR";
		default:
			return "INVALID";
		}
	}

	public void reset() {
		curr_err = ErrTyps.iterator();
	}
}	

